# 基础镜像
FROM ubuntu:20.04

# 镜像创建者
MAINTAINER ubuntu-python36 Docker image "enovo458@126.com" author "drophair"

# 镜像更换国内镜像源(清华源)

RUN apt-get update
RUN apt-get install -y wget
RUN sed -i "s@/archive.ubuntu.com/@/mirrors.163.com/@g" /etc/apt/sources.list \
    && rm -rf /var/lib/apt/lists/* \
    && apt-get update --fix-missing -o Acquire::http::No-Cache=True
RUN apt-get clean
RUN apt-get update
RUN apt-get update --fix-missing
RUN apt-get autoremove && apt-get clean && apt-get install -f

# 编译安装依赖
RUN apt install -y axel screen unzip gcc make bison libcurl4-openssl-dev gawk build-essential
RUN apt update && apt upgrade

# 编译安装依赖库openssl
# RUN cd /usr/local && \
#     wget --no-check-certificate https://www.openssl.org/source/openssl-1.1.1i.tar.gz && \
#     tar -zxvf openssl-1.1.1i.tar.gz && \
#     cd /usr/local/openssl-1.1.1i && \
#     chmod -R 777 /usr/local/openssl-1.1.1i && \
#     ./config && \
#     make -j 8 && \
#     make install && \
#     echo "/usr/lib" >> /etc/ld.so.conf
RUN wget --no-check-certificate https://mirrors.cloud.tencent.com/openssl/source/openssl-1.1.1l.tar.gz && tar -zvxf openssl-1.1.1l.tar.gz && cd openssl-1.1.1l && ./config && make -j 8 && make install && ./config shared && make clean && make -j 8 && make install

# 编译安装glibc
RUN axel -n 20 https://ftp.gnu.org/gnu/glibc/glibc-2.17.tar.gz && tar -zvxf glibc-2.17.tar.gz && cd glibc-2.17 && mkdir build && cd build && ../configure --prefix=/opt/glibc-2.17 && make -j 8 && make install && "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/glibc-2.17/lib" >> /etc/profile && source /etc/profile

# 编译安装